翻訳と辞書 |
String interpolation : ウィキペディア英語版 | String interpolation In computer programming, string interpolation or variable interpolation (also ''variable substitution'' or ''variable expansion'') is the process of evaluating a string literal containing one or more placeholders, yielding a result in which the placeholders are replaced with their corresponding values. It is a form of simple template processing.〔"(Enforcing Strict Model-View Separation in Template Engines )", T. Parr (2004), WWW2004 conference.〕 or, in formal terms, a form of Quasi-quotation (or logic substitution interpretation). ''String interpolation'' allows for easier and more intuitive string formatting and content-specification compared with string concatenation.〔http://perlmeme.org/howtos/using_perl/interpolation.html〕 ''String interpolation'' is common in many programming languages which make heavy use of string representations of data, such as C, Perl, PHP, Python, Ruby, Groovy, Scala and Swift, and most Unix shells. Two modes of literal expression are usually offered: one with interpolation enabled, the other without ("raw string"). Placeholders are usually represented by a bare or a named sigil, (typically $ or % ), e.g. $placeholder or %123 . Expansion of the string usually occurs at run time. == Variations ==
Some languages do not offer string interpolation, instead offering a standard function where one parameter is the printf format string, and other(s) provide the values for each placeholder. Ruby uses the "# " symbol for interpolation, and allows one to interpolate any expression, not just variables. Other languages may support more advanced interpolation with a special formatting function, such as printf , in which the first argument, the ''format'', specifies the pattern in which the remaining arguments are substituted.
抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「String interpolation」の詳細全文を読む
スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース |
Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.
|
|